Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtme-ng: introduce NUMA support #57

Merged
merged 1 commit into from
Jan 29, 2024
Merged

virtme-ng: introduce NUMA support #57

merged 1 commit into from
Jan 29, 2024

Conversation

arighi
Copy link
Owner

@arighi arighi commented Jan 27, 2024

Add the --numa option to create custom NUMA nodes inside the guest and assign virtual CPUs to them.

Syntax:

--numa MEM[,cpus=FIRST_CPU1[-LAST_CPU1]][,cpus=FIRST_CPU2[-LAST_CPU2]]...

Examples:

  • a simple one with 2 NUMA nodes of 2G each:
    $ vng -r -m 4G --numa 2G --numa 2G -- numactl -H
    available: 2 nodes (0-1)
    node 0 cpus: 0 1 2 3 4 5 6 7
    node 0 size: 1971 MB
    node 0 free: 1779 MB
    node 1 cpus:
    node 1 size: 1950 MB
    node 1 free: 1924 MB
    node distances:
    node 0 1
    0: 10 20
    1: 20 10

  • a more complex one, with a 1GB node and 3GB node, each one with a different non-contiguous set of CPUs assigned:
    $ vng -r -m 4G --numa 1G,cpus=0-1,cpus=3 --numa 3G,cpus=2,cpus=4-7 -- numactl -H
    available: 2 nodes (0-1)
    node 0 cpus: 0 1 3
    node 0 size: 1005 MB
    node 0 free: 912 MB
    node 1 cpus: 2 4 5 6 7
    node 1 size: 2916 MB
    node 1 free: 2760 MB
    node distances:
    node 0 1
    0: 10 20
    1: 20 10

Keep in mind that using --numa automatically disables the microvm architecture (that doesn't expose NUMA information).

Also note that virtiofsd requires a memory backed NUMA node, so if some custom NUMA nodes are created virtiofs will use the first one of them, otherwise it will create a single NUMA node that maps all the memory (that was the previous behavior).

But this allows to use --numa and enable virtiofsd at the same time.

This implements the request from issue #56.

Add the --numa option to create custom NUMA nodes inside the guest and
assign virtual CPUs to them.

Syntax:

  --numa MEM[,cpus=FIRST_CPU1[-LAST_CPU1]][,cpus=FIRST_CPU2[-LAST_CPU2]]...

Example:

 $ vng -r -m 4G --numa 2G,cpus=0-1,cpus=3 --numa 2G,cpus=2,cpus=4-7 -- numactl -H
 available: 2 nodes (0-1)
 node 0 cpus: 0 1 3
 node 0 size: 2013 MB
 node 0 free: 1939 MB
 node 1 cpus: 2 4 5 6 7
 node 1 size: 1908 MB
 node 1 free: 1782 MB
 node distances:
 node   0   1
   0:  10  20
   1:  20  10

Keep in mind that using --numa automatically disables the microvm
architecture (that doesn't expose NUMA information).

Also note that virtiofsd requires a memory backed NUMA node, so if some
custom NUMA nodes are created virtiofs will use the first one of them,
otherwise it will create a single NUMA node that maps all the memory
(that was the previous behavior).

But this allows to use --numa and enable virtiofsd at the same time.

This implements the request from issue #56.

Signed-off-by: Andrea Righi <[email protected]>
@arighi arighi merged commit 0703320 into main Jan 29, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant